from mediator import mediator
from mediator . tests . test_assistant import make_mediator_test_keyword_args

class resources_fake :
    def __init__ ( self ) :
        self . _resource = None
    def get_resource ( self , resource ) :
        return [ self . _resource , resource ]

class mediator_resources_tests : 
    'mediator_resources'
    def __init__ ( self , test ) :
        self . _test = test
        self . _resources = resources_fake ( )
        self . _mediator = mediator ( )
        self . _mediator . register_modules ( ** make_mediator_test_keyword_args \
            ( 'resources' 
            , self . _resources
            , None
            ) )
    def test_get_resource ( self ) :
        self . _resources . _resource = 'my resource data'
        self . _test . assume_equal ( self . _mediator . get_resource ( 'my resource type' ) ,
            [ 'my resource data'
            , 'my resource type'
            ] ) 
